package org.dreamwork.jasmine2.sample.ajax;

import org.dreamwork.util.DefaultConverter;

import java.util.Arrays;

/**
 * Created by IntelliJ IDEA.
 * User: seth.yang
 * Date: 2010-12-10
 * Time: 17:08:33
 */
public class ArrayConverter extends DefaultConverter {
    @Override
    public String cast (Object value) {
        if (value == null) return "";
        Class type = value.getClass ();
        if (type.isArray ()) {
            return Arrays.toString ((Object[]) value);
        } else
            return super.cast (value);
    }
}